# coding: utf-8
# Author: zhenda

# 用户模块下的蓝图， 包括用户模块的所有资源
from flask import Blueprint
from flask_restful import Api  # 前后端分离
from comment.utils.output import output_json


user_bp = Blueprint('users', __name__, url_prefix='/user')  # 1创建蓝图
user_api = Api(user_bp)
# 替代装饰器的写法
user_api.representation('application/json')(output_json)  # 自定义的json格式
# 添加资源

from . import user_resource  # 添加资源
# import user_resource  # 添加资源
# from .user_resource import *

user_api.add_resource(user_resource.Shopping_User, '/hello', endpoint='hello')  # 这个漏写了！！ 排查3小时
user_api.add_resource(user_resource.User_SMS, '/sms', endpoint='sms')
user_api.add_resource(user_resource.AuthorizationCodeResource, '/authorization', endpoint='authorization')
user_api.add_resource(user_resource.RegisterUserResource, '/register', endpoint='register')
user_api.add_resource(user_resource.UserLoginResource, '/login', endpoint='login')
user_api.add_resource(user_resource.UserLoginOutResource, '/loginOut', endpoint='loginOut')
user_api.add_resource(user_resource.IsExistPhone, '/isExist', endpoint='isExist')

